﻿namespace _01.CalculateSurfaceExersice
{
    using System;

    class CalculateSurfaceExersice
    {
        public static void Main()
        {
            Shape[] shapes = {
                             new Rectangle(1,2),
                             new Rectangle(1.1,2.2),
                             new Triangle (3,4),
                             new Triangle (3333.33,4444.44),
                             new Circle(5),
                             new Circle(5.5)
                             };

            foreach (var shape in shapes)
            {
                Console.WriteLine("The surface of {0} with dimensions ({1} x {2}) is: {3:F2}",
                    shape.GetType().Name, shape.Width, shape.Height, shape.CalculateSurface());
            }
        }
    }
}